/*
 *  Copyright 2019-2023 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.yangxu.hospital.system.modules.system.domain;

import com.yangxu.hospital.common.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

/**
 * @description /
 * @author 杨旭
 * @date 2024-11-25
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("doctor_schedule")
public class DoctorSchedule extends BaseEntity implements Serializable {

    @TableId(value = "schedule_id", type = IdType.AUTO)
    @ApiModelProperty(value = "排班ID")
    private Long scheduleId;

    @NotNull
    @ApiModelProperty(value = "医生ID")
    private Long doctorId;


    @NotNull
    @ApiModelProperty(value = "是否上午（1: 是, 0: 否）")
    private Boolean isMorning;

    @NotNull
    @ApiModelProperty(value = "是否下午（1: 是, 0: 否）")
    private Boolean isAfternoon;

    @NotNull
    @ApiModelProperty(value = "具体的排班时间 yy-mm-dd")
    private LocalDate scheduleDate;

    @ApiModelProperty(value = "上午开始时间")
    private LocalTime morningStartTime;

    @ApiModelProperty(value = "上午结束时间")
    private LocalTime morningEndTime;

    @ApiModelProperty(value = "下午开始时间")
    private LocalTime afternoonStartTime;

    @ApiModelProperty(value = "下午结束时间")
    private LocalTime afternoonEndTime;
    // 拷贝构造函数
    public DoctorSchedule(DoctorSchedule other) {
        if (other != null) {
            this.doctorId = other.doctorId;
            this.scheduleDate = other.scheduleDate;
        }
    }
    public void copy(DoctorSchedule source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
